package com.huyaanalysisplatform.controller;


import com.huyaanalysisplatform.common.Result;
import com.huyaanalysisplatform.entity.TAreaHot;
import com.huyaanalysisplatform.service.TAreaHotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.huyaanalysisplatform.controller.BaseController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Huadi Group 12
 * @since 2021-08-01
 */
@RestController
@RequestMapping("/areahot")
@CrossOrigin
public class TAreaHotController extends BaseController {
    @Autowired
    TAreaHotService tAreaHotService;

    @PostMapping("/echarts")
    public Map<String, List<Map<String, Object>>> hotShowEcharts(){
        return tAreaHotService.hotShowEcharts();
    }

    @PostMapping("/table")
    public Map<String, List<TAreaHot>> hotShowTable(){
        return tAreaHotService.hotShowTable();
    }

    @PostMapping("/totalHotShow")
    public Map<String, List<Map<String, Object>>> totalHotShow(){
        return tAreaHotService.totalHotShow();
    }

    @PostMapping("/add")
    public Result add(@RequestBody TAreaHot tAreaHot){
        return tAreaHotService.add(tAreaHot);

    }

    @PostMapping("/edit")
    public Result edit(@RequestBody TAreaHot tAreaHot){
        return tAreaHotService.edit(tAreaHot);
    }

    @GetMapping("/delete")
    public Result delete(@RequestParam String id){
        return tAreaHotService.delete(id);
    }

    @PostMapping("/function3/first")
    public Map<String, List<Map<String, Object>>> totalHotOfNetGame(){
        return tAreaHotService.totalHotOfNetGame();
    }

    @PostMapping("/function3/second")
    public Map<String, List<Map<String, Object>>> totalHotOfSingalGame(){
        return tAreaHotService.totalHotOfSingleGame();
    }

    @PostMapping("/function3/third")
    public Map<String, List<Map<String, Object>>> totalHotOfFunGame(){
        return tAreaHotService.totalHotOfFunGame();
    }

    @PostMapping("/function3/fourth")
    public Map<String, List<Map<String, Object>>> totalHotOfPhoneGame(){
        return tAreaHotService.totalHotOfPhoneGame();
    }


}
